package com.szsky.sky.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.szsky.sky.entity.UmcPerson;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 齐行
 * @version 1.0
 * @description: TODO
 * @date 2025/6/18 15:13
 */

@DS("sky_uum")
public interface UmcPersonMapper extends BaseMapper<UmcPerson> {

    @Select("SELECT * FROM `umc_person` p join umc_users u on p.uc_uid = u.uc_uid where u.user_id in (#{userId})")
    UmcPerson getUcUidByUserId(String userId);

    @Select("SELECT * FROM `umc_person` p join umc_users u on p.uc_uid = u.uc_uid where u.login_phone in (#{mobile})")
    UmcPerson checkMobile(String mobile);

    @Select("SELECT * FROM `umc_person` p join umc_users u on p.uc_uid = u.uc_uid where u.login_email in (#{email})")
    UmcPerson checkEmail(String email);

    @Select("SELECT * FROM `umc_person` p join umc_users u on p.uc_uid = u.uc_uid where p.cert_num in (#{certNum})")
    UmcPerson getUcUidByCertNum(String certNum);

    List<UmcPerson> getUmcPersonByUcUid(List<String> ucUids);

    List<UmcPerson> getUmcPersonByUserId(List<String> userId);
}
